package com.group.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.group.entity.User;
import com.group.service.UserService;
import com.group.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.group.common.BaseController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Yann·Z
 * @since 2021-12-20
 */
@RestController
@RequestMapping("/user")
public class UserController extends BaseController {


    @Autowired
    private UserServiceImpl userService;



    @PostMapping("/login")
    @ResponseBody
    public Object loginUser(@RequestBody User userVO){
        QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
        userQueryWrapper.eq("user_name",userVO.getUserName());
        User one = userService.getOne(userQueryWrapper);
        return one;
    }


}
